import type JWTTokenCacheVO from '../../common//vo/JWTTokenCacheVO' 

export default class JWTAccountVO  { 
  accId!:string;
  accName!:string;
  accType!:number;
  userType!:string;
  userName!:string;
  accStatus!:number;
  userPortrait!:string;
  roleId!:string;
  userId!:string;
  accRoleOrgIdList!:string[];
  subdOrgIdList!:string[];
  ipAddr!:string;
  accessTokenId!:string;
  refreshTokenId!:string;
  /**jwt对象信息 */
  jwtTokenInfo!:JWTTokenCacheVO;
  tokenStatus!:EnumStruct<BaseEnum_ResultStat>;


  /**通过JSONObject创建实例对象 */
  public static getInstanceByJSONObj(jsonObj:any):JWTAccountVO{  
    let instance=new JWTAccountVO()  
    return Object.assign(instance, jsonObj) 
  }


  /** 通过属性参数创建实例对象 */
  public static getInstanceByParam(accId:string,accName:string
                                   ,accType:number,userType:string
                                   ,userName:string,accStatus:number
                                   ,userPortrait:string,roleId:string
                                   ,userId:string,accRoleOrgIdList:string[]
                                   ,subdOrgIdList:string[],ipAddr:string
                                   ,accessTokenId:string,refreshTokenId:string
                                   ,jwtTokenInfo:JWTTokenCacheVO,tokenStatus:EnumStruct<BaseEnum_ResultStat>){ 
    let instance=new JWTAccountVO()  
    instance.accId=accId;
    instance.accName=accName;
    instance.accType=accType;
    instance.userType=userType;
    instance.userName=userName;
    instance.accStatus=accStatus;
    instance.userPortrait=userPortrait;
    instance.roleId=roleId;
    instance.userId=userId;
    instance.accRoleOrgIdList=accRoleOrgIdList;
    instance.subdOrgIdList=subdOrgIdList;
    instance.ipAddr=ipAddr;
    instance.accessTokenId=accessTokenId;
    instance.refreshTokenId=refreshTokenId;
    instance.jwtTokenInfo=jwtTokenInfo;
    instance.tokenStatus=tokenStatus;
    return instance 
  }


  /** 类属性的申明静态变量(适用于直接用到Class.fieldName的场景) */
   static fieldNames={
       accId:"accId",
      accName:"accName",
      accType:"accType",
      userType:"userType",
      userName:"userName",
      accStatus:"accStatus",
      userPortrait:"userPortrait",
      roleId:"roleId",
      userId:"userId",
      accRoleOrgIdList:"accRoleOrgIdList",
      subdOrgIdList:"subdOrgIdList",
      ipAddr:"ipAddr",
      accessTokenId:"accessTokenId",
      refreshTokenId:"refreshTokenId",
      jwtTokenInfo:"jwtTokenInfo",
      tokenStatus:{code:"tokenStatus.code",value:"tokenStatus.value",this:"tokenStatus"} } 
}

